package com.wang.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.wang.service.IDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
public class DemoController {


    @Autowired
    private IDemoService demoService;

    @NacosValue(value = "${my.name:www}",autoRefreshed = true)
    private String userName;


    @GetMapping("/getDemo")
    public String getDemo(HttpServletRequest request){
        System.out.println(userName);
        return demoService.getMsg("");
    }
}
